Port many changes from develop