Fix clear and exit commands and Fix use of promises, exec and hash change