Fixed incorrect setting of heap in create_call_frame(), added asserts, misc cleanup