Fix locking
Tweaks for immutability of transforms
NPE check