Fix bug in get_by_ext