Small fixes and a little bit of debuggery