fix preprocess script, clean up old objects