Fixed issue #14 and issue #16.