Trying to fix issue #297

Maybe this can be the final fix.