Fixed Bug #17 and Improved Error Messages