Fixing some bugs, added some debugging stuff