Added ResourceStateExceptions and made some other small changes.