Fixing wrong array copying

Signed-off-by: Henrique Vicente <henriquevicente@gmail.com>