Fixed memory bug. Made sure that the kernel is initialized outside the try catch scope.

Changed the metatable name for classes. Added missing dependency