Fixes bug with invalid regexp