Some fixes on the register (thanks Immo!) and changes in the cleanup
script.