Fix mode issues

fixes #2128, #2203,  #2221