minor optimization corrections