A number of performance fixes to prevent shelling out on every request.