Fix bug with empty geometrycollections (#4751)