Several minor changes and bugfixes, more gson minimization.