fixes and initial support for some of Br. Naveed's contributions