Small fixes.

* suppress warning of cast
* remove unnecessary unary plus
* guarantee variable *str_flags* in regexp flags check is NUL terminated string.