Improved doc and made repl more resilient