fixed cache issue. added tests
fixed RegExp test bug