Fix substitute flags. ref #30