Attempted fixes for performance.