Manually merged changes of #444