Some improvements for scripts