Fix bug with empty tables and add option to clean database before test run.