Several random small cleanups to twisted