Trim bases that are out of bounds.
Fixing bounds here seems to fix issue with negative values in #69