Issue #42 and Issue #45 fixes