Try and fix bug#788, hopefully for real this time.