Minor corrections, fixed a clang warning

Hi, I made a mistake in the last pull request, so I am opening a new one.

This code corrects the order of the cmake command arguments. In addition, a minor bug is fixed. As far as I understand the code it only caused useless copying but should have no visible effect to the user. This fixes a warning when compiling with clang.

Best regards,
David