Fixed functions not correctly generating their return type
Merge branches 'master' and 'misc'