Small optimization for #1003