Fixes python crashes.