Addressing issues #14 & #15. Porting changes from 2.8 to 2.7