Adding some bad data handling for boundaries.