Improved error handling and error messages
Fix regexp
Fix regexp