r1491 + fix missing global declaration