Fixing #808 bugs

#808 corrections