various fixes/cleanup