Use resolved /dev nodes. Fix some compiler warnings. Fix global locking