Perf improvements, fixing programs