Added better handling and checks for NT_STATUS_ACCESS_DENIED