Fixed an error in the IndexSpace comparison method and make format_as errors more informative