Fix a bug and fix another bug that relied on this bug