Bugfixes

* disallow to write characters other than digits and semicolon
* fix memory leak