added tests
fixed string capture regexp
fixed error trace.