Fixed narrow rect packing issues
Added Unit tests