Should fix #20
Added debug for #22 (this is going to be annoying)