fix for areas of truly bad data causing segfaults