Add throw, try/catch, new and fix bugs