Add support for writing existing active group
Fix NPE if an item file contains no items