fixes cartodb queries and km2 error