Minor optimizations + tweaks