Added in a few extra checks for incorrect UTF8 sequences