improve placeholder management. fixes #712