Temporary fix for issue #4.

This is not a final solution. The class needs exhaustive automatic
tests for checking when this happens.