Fixes for ts-2954
Corresponds to the ts-2954-final.patch attached to that bug