Various small fixes & cleanups