Somepatches

This branch is composed of various fixes that are required to run the ock testcases. It also includes t_destroyobject which is also required by testcases.
Marcelo has already reviewed. Another reviewer required so it can be merged.