Fix some bugs in celestial transformations