Add remaining tests, fix some things