Remove debug print statements but keep the error checking