Code cleanup for HA fixes.