Fix dangling pointer

This PR remove some dangling pointer in bytecode loader.