Solves issue #6981