Fix bug in single-level package names (found and fixed by Dean Harding)

@codeka
@JakeWharton @swankjesse