Fixed #16 and also #17

This fixes #16. The last commit fixed #17, but I made a typo in the
commit name and put #11 instead of #17.