Improved error reporting when parsing profile