Added printing of errors