bug fixes and dynamic replacement policy