Better error handling
Added support for empty lines and comments