Fixed issue #7 and possible #8