Issue #7
Some changes to be more backward compatible