Changed file checking, bug fixes.