Check for empty list instead of null. Issue #46.