The fist issue was an exception, easily resolved, however the next issue is it doesn't throw an error at all, just crashes, I strongly suggest a step through, some code breaks and catching every possible exception, if you are firing code, then wrap it in a try catch. Also does it work on your machine?
NVM, Issue resolved, Please do post the solution so we can mark it solved.