Fix a bunch of bugs relating to permissions.

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