Minor efficiency improvements

latest commit 5401a0dac1
@edwinfinch authored