Fixes IoUtils#toFile not to include extra null characters at the end.
Merge branch 'release/2.2'