Several fixes
Multiple flipping bug