improved return carriage handling in generated classes