Fixed the random deletion bug by switching the unsigned output to signed output in get first empty point