Regexp optimizations, indentation fixes