solaris-fixes branch: Applied the swap-patch by Christophe Kalt.