Fix empty sequence ValueError