Minor error checking performance optimizations