Various tiny optimizations