Closes #11 and closes #12 - sorry mixed two bugs.