Fixed two bugs. First, -0 caused an infinite loop. Second, the subexpression array was not being cleared