Fix panel flipping