Fix adding and removing temporary stat modifications, closes #248