Fix missing then and remove whitespaces