Add hack for backward compatibility and some minour style changes.