remove uneeded memcpy + fix some initialization error case