several fixes and improvements. some cleanup.