Bug investigation

A lot of good stuff going on in here.