Error messages are better displayed

Related to #339