Fixed bug with mass assignments
Added regression test for #3