Fix for issue #8: NaN is appearing instead of numbers
Fix for issue #7: Doesn't close when focus is lost from input field