Fixed problem with math on invalid types