Misc fixes v3

https://redmine.openinfosecfoundation.org/issues/1092
https://redmine.openinfosecfoundation.org/issues/1112

Prscript:
- PR build: https://buildbot.suricata-ids.org/builders/inliniac/builds/197
- PR pcaps: https://buildbot.suricata-ids.org/builders/inliniac-pcap/builds/117