Fix some bugs

As explained in each commit msg

Implements a more robust fix than https://github.com/BrandwatchLtd/selleckt/pull/6