Fix to skip non-hex characters properly. Thanks to: You Nakatsuru