Updated with latest changes from master