Fix warnings if $scripts is not an array