This fixes #26 and fixes #27