Don't write rating if not set
Fixes issue #4128
Try to fix issue #4582