Fix error handling with get_tables

and fix an issue where newlines in the dataset_url could
cause problems.