peer detach of an invalid peer gives the error bricks exist if the bricks are not resolved. This happens because the peer and the brick have null uuids. This should be handled.
PATCH: http://patches.gluster.com/patch/5534 in master (mgmt/glusterd: resolve the bricks before comparing uuid)