Fixing package transforming bug when elements are missing.