Improvments to script/stackprof. [ci skip]