fixed build errors and added EF 5