Fix embarassing bug with registration
Add command line registration tool