Some fixes for linux. Still some issues left.