Added set mode flag support.