more flattening fixes

Previous commit is very unhappy.  This one is much happier!