Made some types of invalid expressions fail gracefully.