small fixes for a script