Fix bug in PropertyPlaceholder and add unit tests.

Close #6034