Minor type fixes/performance fixes.