Call db_connect(TRUE) instead of db_pconnect() + some style changes