Several code updates to fix issues
Merge pull request #264 from FWAJL/dev

Several code updates to fix issues