Fixes for Python layer.