Fix some leaks and rename commands.