Fix usage examples

Some minor fixes for the usage examples.
In particular this fixes `mkstemp` template with the six required trailing `X` s and the `capturePreview` example which does not work.