Fixed tests and permissions stuff.