port missing code pieces from >0.17.11