Added support to console, added a command to flush the cache and some fixs