Fix error with automatic flag setting.

Do not set automatic flag for local packages unless it is really needed.