Fixed a lot of bugs. (Divide by zero, clear button, etc.)