Ok, let's add the appropriate automated tests before merging this.

I'll look into in today or tomorrow for sure.