Fix #48

Still no idea exactly what this does, but hopefully it'll come in useful
when I start tackling #16