core: minor optimizations.