Fixed bad logic error with testFlags. should return masked bits