fixed avi encoding, some tests still failing