Implement permission fixing

Test is not operational yet. Fix #7.
Make "manage test" able to take more arguments