pybind: Some fixes on semantics