Revert "fixed bug #3319"

See 092f916 for explanation.

This reverts commit 4f9c081dc313f8fdfee3f0a4572779ae13e27e40.
Re-fix bug #3319 with less side effects.
Removed an unnecessary workaround for matrix-to-vector copyTo.
Added a test for matrix-to-vector copy and convert.
fix cross-compilation issue with Numpy
reorder the if's for clarity