added maximum file size, fixed regexps