Added checking if array offset is set before assigning value to word property

Also added utf8_decode before assigning value to word property, But that doesn't make any sense since the $buffer variable was already encoded...