Revert "Use empty() instead of size() == 0."

This reverts commit r194551 because it broke the buildbot.