Add command-line example
Try to improve error handling