Added guard, cosmetic changes to test