Fixed window issues in get_fence and put_fence