Adds in math functions.
Also fixes an issue where errors weren't being displayed at all