Fixed bug with flip and rotate overwriting