A few performance fixes.