Fixed bug where removing a mod doesn't free the location slot.

Fixed #5246