Fixes in WriteDetector