Improve emptiness checking.