Fixing issue #28 and issue #30.