Clean up a lot of old code. Fix notorious issue where the count would stay 1 of 1 forever.