Initialise variable instead of throws exception
Added test for #287 issue
Fixed pregmatch tests