Fixed NPE in loader
Fixed assertion failure in clone visitor
Started fixing more NPEs