Removed some debug printing and updated an error message