This fixes #2 and also fixes #3