Fix build.

- Removed deprecated attributes.
- Fixed libstd calls.
- Fixed some build errors.