Fixed bug caught by test_subsasgn.m
Minor performance tweaks