Fix MD and SMD hashing