Fixed a bug described in #7