Fixed bug in unload.