Changes to the way sdevs are handled and bug fixes