Made error* private and added setters
Setting proper error codes