Several fixes for DragonFly (rebase)