More improvements to some scripts