Fixing problems with the incref/decref management
Minor tweaks