New unittests added and some bugs fixed, changed member fields of entity classes.