Comment and spacing issues fixed

Handled the case of a directory or a non-sh file being passed in. Corrected the pointed out issues.