                 var obj: HSQOBJECT = HSQOBJECT()
                 sq_resetobject(&obj)
                 sq_getstackobj(vm, SQInteger(position), &obj)
-                return .Object(SQTable(vm: parent!, object: obj))
+                return .Object(SQTable(vm: SquirrelVM.associated(vm: vm), object: obj))
                 
             default:
                 return .Null

        
        // MARK: - SquirrelVM::Stack::private
        private let vm: HSQUIRRELVM
        private weak var parent: SquirrelVM?
    }
}

        self.init(stackSize: SquirrelVM.DefaultStackSize)
    }
    
    public static func associated(#vm: HSQUIRRELVM) -> SquirrelVM {
        if let vm = ~vm {
            return vm
        }
        
        return SquirrelVM(vm: vm)
    }
    
    deinit {
        vm ~ nil
        sq_close(vm)
    }
    
