Small optimization for #412 fix