Fix some slope related bugS