Manual merge possible fix for #2 part 1.
Manual merge of possible fix for #2 part 2.