Add 4 to version sniffing code

Fixes #336
Replace `^` with `\A` while you are here?