Fixed saves empty lists

The program was saving empty lists that happened to be in the map,
which is a waste of space. Now, it checks if a list is empty, and
doesn't serialize it in that case.