Fix tons of JoshEdit bugs.