[svn] Fix refleaks and API usage in C module. Will need to test the changes though.

--HG--
branch : trunk
1 file changed