fix buffer overflow in copyChunk
fix loop reset to beat 0