Fix a bug repoted in #173