Use a generic function to register slash commands
Minor syntax fixes