Error handling updates

More robust to edge cases
New idea for lattice shrinking

Shrinking is relatively unsafe compared to growing, so only do it once
at the end.  I think the old way was causing some endless loops.