minor edits to make older scripts work