Fix compilation. Functionality yet untested.
Fix implicitly declared functions
Fix metadata handling by moving it from _base_init to _init