Fixed issue reported by Chris Nossing (packagelist depending on other statements). Compacted a few lines to simplify a bit.