Added code to force Code to be released when a Code entity is unloaded.