general script fixes