some minor changes that should help avoid errors