Implemented message filters for ensuring transform availability.

Also did some small code cleanup for safely obtaining transforms.