Remove blank lines and correct regex's