minor cleanup and new tests