Fixed a infinite recursion at closing time

Thanks Simon for letting me know.
I do not know how I managed to miss that.