fixed some edge cases with  expression parsing