Finalizing things, and removing dead code