Fixed bug raised in #37 discussion