Update changelog and version to 0.40.0