Some changes to fix issue #3