Fixed inheritance/copy-paste bugs, modified REGEX.