Bug with points of discontinuity solved
some little fixes