fixed handling of "doPrivileged" calls