Removing test function.
Adding code to treat errors callback.