Fix logic error where 1 is considered prime