Fixed issues, added file type and open file protection to fprot