Fixed #297 by redoing the change from #273
Merge pull request #298 from misl/master

Fixed #297 by redoing the change from #273