Revert "Fix a bunch of small system/core bugs."

This reverts commit 661dcc0ee9cebbe550ebec355357b16f15382b6d.