Added checks for gradient with signed types; fixed error that happened with signed int8 type; added Doxygen warning not to use unsigned types.