Various fixes

Style fixes, egg reference fix, and mild refactors