Changed NULL by nullptr and other minor style changes.