Fix errors caused by `double.as_null_object.freeze` on 2.99

This fixes #698.