Add some asserts for safety