Fixed memory copy error

and some other details :)