C++11 range based loops.
fixed file exists method