Further accuracy improvements and cleanup.