Check fixes

A bunch of fixes for 'make check'. Mostly regressions.