Fixed database path retrieval to only convert path once.