Fix parseing functions to return an error message if the parse failed