Merge "Replaced some !count() with explicit and more efficient check"