Cleanup code merged in pull #2
Fix file existance check.