Fixes erroneous if statement
Fixes erroneous spacing and while loop condition