Clean up hex parsing a bit