Some calls declared static to make gcc stop complainig about non existing prototypes