Fix if statement, add more tests