Fix zip detection code