Resolve issues with 3.x

Fixed issues to make arrow work in 3.x. Tested on 3.3.1 and 2.7.3