Added new exception
Found bug in pointer escaping, added tests and attempts to fix it