misc fixes (including #492)