Killed warnings: added types to vars etc. Also added ...args to functions that are callbacks for ()* regexps