Fixes #20
Fixes #19
Fixes #21
Attempt to fix #13