Arrow-related cleanup and bugfixes.