Minor optimization fixes.