Return false if collection is empty.

Fix #1714.