Fix warnings from magic methods