Minor fixes

Small performance upgrades