Read complete error message not only the header
Fix errors mentioned by JSHint