Fixed the when syntax issues. The syntax was previously ambiguous.