Fix a nasty bug