minor changes resulting in more robust behavior