Fixes #18 and fixes #19 and fixes #15