Fix error logging
Improve regex coverage