Cherrypicking #55 fix