misc. fixes and improvements