Permission bugs fixed