Map::replace() and Map::tryReplace() now set "$previous" correctly (fixes #28).