Minor improvements and fixed issue #1