Port dcb6156bc52bca437f3f00098bf32b192331db35 on master, close #301