Fix a couple of differences compared to libcore