fixes to errors caused by copy_if sketch