Minor code updates and cleanup.