Updated with latest features from master