Bugfix - bezierCurve calculations silently fails for datasets with 1 point only.

Added "if" and appropriate indentation.

Fails because of using index = 1 for single element array.

EDIT:
In fact only the first commit in significant.
The second one is another enchancement I made, wanted to create it as a second pull request but failed due to my insufficient git/gihub knowledge ; )
Should be made in seperate branch I think, would be grateful if somebody advised me.