Added changes from distributions branch