Fix exception handling in fetching remote profiles