updated some asserts, errors, and checks