fixed issue #18
fixed issue #25
fixed issue #19