Fix exceptions in OClassImpl.setShortName

Fixes as discussed in #1659