Fix OS detection
Bad copypasta
Incremental DB upgrade mechanism