Fix up for issue 6453 change, allow shared/synchronized invariants

But mixing non-shared/shared/synchronized is currently rejected.
Merge pull request #2028 from 9rnsr/multi_inv

Fix up for issue 6453 change, allow shared/synchronized invariants