Fix a few bugs from last NIO2 commit in resource translation