Fix error with replace_copy function signature in algorithm component

Add more tests for algorithm component