Small fixes

A collection of small fixes/improvements. No feature changes.