Small optimizations

No big optimization here, around 0.03s on a 0.6s mapping. Anyway, it can’t hurt.