Modified $.inArray to match jQuery behavior.