Okay here it is working. Fixes #3. Fixes #4.