fixed missing require; small code refactoring;
Fixed index/slice bug -- e.g. the following wasn't a valid expression
[1,2,3][1,2].