Close #22

But there a bunch more weird bugs I just found