Updated to flush cache before exiting in exit path mode and allow short reads without returning an error as they seem to be expected