Some performance fixes.