Adding open that will decide between hdfs, curl and local FS. Possibly found a compiler bug with return statements inside if statements