Fixed the bug with item replacement being broken