Code cleanup. Bug squashing before presentation.