Change return type for bad resource type in get_resource, which had a bug. Fix test.