Fix for STS-3091

Ensure structure is consistent with contents after creating.
https://issuetracker.springsource.com/browse/STS-3091