EAGLESIX-2716 Fixed broken variable declaration, added error codes.