Fix and simplify scripts.