Changed test to only perform operation on last switch entry.