More Bug fixes in the scripts