fixed some missing code and added ref calls for transform objects.