Fixing issue #123 and issue #124