Several fixes (closes #3127, closes #4489, closes #4479)