Fix incorrect handling of Database data on many __construct() methods

Database::query() returns an array which contains every row belonging
in the results of the query. Since we are querying by ID and ID is a
unique identifier, the result of the query must be only one, so use
$results[0].