fix for issue 391 and issue 307
fix for issue 391 and issue 307

fkarb/pika-python3,jstnlef/pika,reddec/pika,pika/pika,vrtsystems/pika,zixiliuyue/pika,hugoxia/pika,shinji-s/pika,skftn/pika,renshawbay/pika-python3,Zephor5/pika,knowsis/pika,benjamin9999/pika,vitaly-krugl/pika,Tarsbot/pika