actually fixing this would take this port further from the reference implementation in a bad way