fix bug in evaluating array expressions

found this through steves test case
also fixed minor issue in test case which made me spend time
looking into the wrong issue