Some changes to #341