Replaced calls to error() with print_error()