Fixes #9.
Fixes #13.
Fixes #14. Accidentally declared class variable.
Fixes #17.