Provides powerful error checking with debug printing.