Add additional safety checks and file types.

Added a check to see if the path exists before using it, added new file types, expanded array for readability, made file types and working directory appear more constant.