squashed problems with .having()

based on #48 + with a slight update to correctly handle raw + a couple tests