Several fixes, added multiline support, added queue timeout