Fix NPE and improve code
Improve help