Refactored tests. Nit fixes.