Fixed returning of error message.