GenerateEfCode bugfixes