Removed duplicate error codes and debug code