- Add new function for the new slope calculations.

Fixed also two MSVC warnings.