fixed seg fault from trying to fclose, also added -h args