Bug fix, multi-threading support, shell mode