Sync with libnpa (Chaos;Head)