Add more tests
Fix portability of cmd_pdn