Fixed issue #3 and also #1.