Fix bug where NullPointerException occurs when there are no domain types.