Various small fixes/cleanups