Minor cleanup and more tests