fixes to batteries/atdgen