Fix NPE in binary logging