fix a bug reported by Dudeman on #v-d