Fix issue #1359

Remove of unused $db and remove the option of passing a Database_Connection instance for $connection