Applied diff from #44