Fixed incorrect detection of request to read and write. In rare cases it may lead to deletion.