Re-ordered some statements to ensure that filetype detection for ps1 files work.