Add jar builder
Fix NPE in rare case