Better error on unknown API packet type.
Fix compile warnings in old code.