fixes and asserts