Fixed various bugs in video copy and merge scripts