Fixed issue #6 and eventually #2