Avoid allocation of empty lists

Signed-off-by: Stefan Marr <git@stefan-marr.de>