#172 #192 #207 #221 Fixed issues with min=0 or max=0

Hi,
I modified the code for handling min and max values, especially for 0 but also for handling negative values. I did a brief test both with the html scripts in the test folder and html file attached to issue #221 and it looked all good to me.
Hope that helps you maintaining that great library!