Fixed bug in pgrep and 'as_user' function