fixes #18 and fixes #19