Merge upstream

This PR merge bug fixes and improvements form our upstream [GeoNode/geonode](https://github.com/GeoNode/geonode) to stay in sync.