Fix setCapacity(0) crash and 2 BEAM errors
Fix setCapacity(0) crash and 2 BEAM errors

mklight/eCMD,mklight/eCMD,mklight/eCMD,open-power/eCMD,mklight/eCMD,open-power/eCMD,mklight/eCMD,open-power/eCMD,open-power/eCMD,open-power/eCMD