Added specs and fixed operator associativity and precedence.