Fixing the caption generator