Needs bugchecked for some spurious output.