Integrating latest changes from Brett