Improved error handling when collection is not specified