clean up and a few new tests

Change-Id: I02db104e505fbc60ba2bc3d027ab38a918fc77d1