Fixes bug in automatic permission settings