Couple of minor fixes

hi, during my first attempt of generating bindings for opencv i came across a couple of issues i managed to fix as you can see by the referenced commits.
i've also added some example code which broke either the generator or the generated bindings to each commit.