Update tests and minor cleanup.