Fix bug of not waiting for script to init before looking up commands.