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

Several code updates to fix issues