Fixed some bugs with ariphmetic operations