Fix asserts on reading