Fixed check on DB type