Fix bug when passing nil headers to JSON convenience method
Fix conditional compilation