Cleanup of old constants and check for optimization depth.