Trap invalid vectors
Add an assert to help coverity
User memmove for overlapped memory copy

Reported by coverity
Merge branch 'atronix' into coverity_scan