Added safeguard against out of bounds partial writes resulting in long timeouts.