Simplify and correct calculation of inventory slots in bank command.