Fixes

Several unrelated fixes.