Fixed recursive copy function filtering to not go into recursive loop.