Fix for Issue#2 and Issue#3