Third attempt at fix #285. This should do it