Fixed buggy md5 unique_name support and added tests to prove it works