Fix bugs

Fix the error when input start with a zero
Fix the error when input have only zeros after the point