Added in debug info and fixed a couple of bugs