clear_database clears status and logs. Small fixes and cleaning up