Check for empty collections to avoid a bindingexception