Fixes two incompatibilities between the current and reference implementation