Patch contributed by Juho Peltola, VTT Resolves bug-report https://bugs.openfoam.org/view.php?id=2699