Fixes python crash