Fix bugs & remove old code.

100% test passage here.