Fixed #662 -- Improved performance of subscript assignment, added a test for it.