Some bugs fixed

Issues with flips don't occur and pamf fail.