Some performance tweaks (hopefully)