Add a test for undoing after cropping
Fix undo state dimensions being wrong after crop