Code cleanup: empty lines and comments
Add test cases for rd_duplicate_function()