Gracefully handle some invalidity in morph shapes

Fixes one of the issues in #859