Added new logging, and fixed a bug with addition typechecking