misc. cleanups & patches