Bug fix: sprintf breaks if variables contain %