added test cases and fixed a bug around write blocking
Merge remote-tracking branch 'origin/master'