Fixed COG mask bug. Added provisional rotatepivot.