Fixed a few bugs, inserted a sanity check attribute in all objects (__type__)