Fix merge glitch and missed optimization