More tests (yay) and some fixes