Sorted out printing of error message.