Fix building for visual studio. Improve db::set_status state processing.