Fixed a regression that broke unload call. Added a unit test for this case.