Misc. cleanup (see commits for details)