Improve usability and fix traceback