fixes from pr #817