Fixed issues
Improved database and table API.