fix bugs introduced in previous #472 fix
fix bugs introduced in previous #472 fix

LucasCabello/anki,hssm/anki,kenjhim/anki,abeyer/anki,go38/anki,xuewenfei/anki,holycrepe/anki,florianjacob/anki,jkitching/anki,Arthaey/anki,weihautin/anki,eduOS/anki,hssm/anki,sunclx/anki,Stvad/anki,socialpercon/anki-1,subfusc/anki,jakesyl/ruby-card,ospalh/libanki3,weihautin/anki,jakesyl/ruby-card