Fix declarations for functions in examples

Thanks to Andrea Vigliotti for spotting this.