Fixed two regex problems, reordered functions alphabetically, improved (debug) output.