Various text class fixes