Fixed issue #56, thanks to gregoiresage