Fix issue #1624

I don't know, if my solution is safe.
If it is not safe, please don't merge.

Thanks.