Bug fixes and mlib.shape:remove