The "is_user_SYSTEM" method compares (case sensitive) the result of GetUserName to "SYSTEM". Problem is that GetUserName returns a localized version of the user name (at least on W7). For example on a french version of W7 ther returned name is "Système" so the test fails.