Meges most recent fixes from gerrit and compile errors