Correct beta function for negative arguments.

Also correct documentation for lgamma and lbeta. And some tests.