add fixes from pr 117