Various fixes v1

https://redmine.openinfosecfoundation.org/issues/1105
https://redmine.openinfosecfoundation.org/issues/1107

Prscript:
- PR build: https://buildbot.suricata-ids.org/builders/inliniac/builds/185
- PR pcaps: https://buildbot.suricata-ids.org/builders/inliniac-pcap/builds/105