Feature/java protocol generator fix

A couple of fixes for new protocol stuff in Java generator

@jonasacres