Clean up db opt error check