Fix regex bug

Wrong parenthesis in Regex.

Fixes #512 and #513