Code cleanup and updates.