Script output issues fix