Applying Istvan's fix