Modernised and fixed warnings.