Rewrote regex parsing to avoid bug in SnakeYAML (Thanks @Dykam)

Minor bug fixes