merged ns-3.18 changes from master correctly
working merge of 3.18 master