Corrected the theilslopes implementation and added a test