Modernize function declarations and a few retvals - the retvals are incomplete