Fixed prime number check. Fixes #2.