Refactor error handling in demo command
Add missing assertion in demo dir test
Clean up config