Replacing more num with double in API

Also fixed a bug in the vec4 array copy.