Fix function names. Add gradle.
Merge upstream.