Fixed bug in error print