Fix error when query or body doesn't exist.