Fix Errors on throw

Sorry about the last push this one is comprehensive
Merge pull request #96 from Tarangp/master

Fix errors on throw