Misc. cleanup and fixes.