Various cleanup. Stable commit.