More complete sync from the Maestro client fork.