Pick correct IO::Spec when running on JVM.
Fix double-container bug with 'as'.