Fixed filename and package builder logic in generated files. refs #418