Improve cli parsing based on review feedback
Prevent NPE if close is invoked twice