Working data logging

- fix bug in command length. now it is unsigned short evrywhere
- fix bug with sqlite3_bind_text
- add call to sqlite3_reset