Fixed several parsing bugs in Term and Expression