fixed issues #18 and #15