The function is_prime(n) should return True if n is a prime number, False otherwise.
There are two bugs hidden in this function. One causes incorrect results for small inputs. The other makes the function silently accept some composite numbers as prime.
Find and fix both bugs.