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

Several code updates to fix issues