Fix flipInX and flipInY

Currently flipInX and flipInY are broken, this code will 
a) fix the flipInX and flipInY to work and
b) fix the syntax of the @else if statements

Both are working in my test environment.