Fixing bug in compartment addition