fixed arithmetic errors in element copies and index shifts.
Authored by: outchy 2010-12-21
Parent: [r24]
Child: [r26]