Changed file mode, added case insensitivity