bug fixes in :wrap