Internal error checks converted to asserts