Minor optimization - adding early bailout if given key is nil