Added method to check for file existance.

Added method to check for file existance.
Minor bug fixes.