bugfix
Fixed issue #30 and issue #37