Additional tests and minor cleanup