Some improvements for HbContext