Fixed missing end of if statement
Fixed bugs, added site id, added site-specific package support.