Reverting merge of 1356 and subsequent fixes