Reload collection UDFs after saving them to retrieve ids

Fixes #1534