#166: Fixed HQL query.