Fix some bugs in the permission evaluation code.

Fix a couple name errors as well as an issue with the algorithm used
to determine if a set has a given permission.

Signed-off-by: Tyler O'Meara <Tyler@TylerOMeara.com>