Implement writeNullAP and writeBoolAP