Fix bug in fillPlaceholders function