Handle empty subjects properly.

fix #586
Merge branch '1.1.x'