Fixed missing permission error handling.