Added several tests for the identity manager and error corrections