#26 Added try..catch block around error-prone function calls.
Merge pull request #29 from jamsesso/BugFixes_26

#26 Added try..catch block around error-prone function calls.