item was dereference previously. While there, reorder some test for faster early out. Coverity 1139844