Fix bugs in code for eol, consolidate