Better input expression handling