Issue 1:
Setting the collection of labels on a node can duplicate labels

> curl -i -H "Content-Type:application/json" -H "Accept:application/json" -X POST 'http://localhost:7474/db/data/node/'

Creates a new node with id 7

> curl -i -H "Content-Type:application/json" -H "Accept:application/json" -X POST 'http://localhost:7474/db/data/node/7/labels' -d '"FOOBAR"'

Adds a new label "FOOBAR", which succeeds and can be verified by GETting the labels for node 7

> curl -i -H "Content-Type:application/json" -H "Accept:application/json" -X POST 'http://localhost:7474/db/data/node/7/labels' -d '["BAZQUX"]'

Adds a new label "BAZQUX", which succeeds. GETting the labels for node 7 shows '[ "FOOBAR", "BAZQUX" ]'

> curl -i -H "Content-Type:application/json" -H "Accept:application/json" -X PUT 'http://localhost:7474/db/data/node/7/labels' -d '["BAZQUX"]'

Also succeeds, but GETting the labels shows a duplicate label:

> curl -i -H "Content-Type:application/json" -H "Accept:application/json" -X GET 'http://localhost:7474/db/data/node/7/labels'

'[ "BAZQUX", "BAZQUX" ]'

Deleting the label only deletes one copy of it

> curl -i -H "Content-Type:application/json" -H "Accept:application/json" -X DELETE 'http://localhost:7474/db/data/node/7/labels/BAZQUX'

> curl -i -H "Content-Type:application/json" -H "Accept:application/json" -X GET 'http://localhost:7474/db/data/node/7/labels'

'[ "BAZQUX" ]'

Attempting to delete the label gives a 500 server error and leaves the following stack trace in the log:

==> data/log/neo4j.0.0.log <==
Oct 03, 2013 12:57:00 AM com.sun.jersey.spi.container.ContainerResponse mapMappableContainerException
SEVERE: The RuntimeException could not be mapped to a response, re-throwing to the HTTP container
java.lang.IllegalStateException: Label 0 not found.
at org.neo4j.kernel.impl.nioneo.store.labels.LabelIdArray.filter(LabelIdArray.java:60)
at org.neo4j.kernel.impl.nioneo.store.labels.InlineNodeLabels.remove(InlineNodeLabels.java:82)
at org.neo4j.kernel.impl.nioneo.xa.WriteTransaction.removeLabelFromNode(WriteTransaction.java:2165)
at org.neo4j.kernel.impl.persistence.PersistenceManager.removeLabelFromNode(PersistenceManager.java:411)
at org.neo4j.kernel.impl.api.state.TxStateImpl.nodeDoRemoveLabel(TxStateImpl.java:378)
at org.neo4j.kernel.impl.api.StateHandlingStatementOperations.nodeRemoveLabel(StateHandlingStatementOperations.java:168)
at org.neo4j.kernel.api.operations.ConstraintEnforcingEntityOperations.nodeRemoveLabel(ConstraintEnforcingEntityOperations.java:144)
at org.neo4j.kernel.impl.api.LockingStatementOperations.nodeRemoveLabel(LockingStatementOperations.java:82)
at org.neo4j.kernel.api.OperationsFacade.nodeRemoveLabel(OperationsFacade.java:454)
at org.neo4j.kernel.impl.core.NodeProxy.removeLabel(NodeProxy.java:531)
at org.neo4j.server.rest.web.DatabaseActions.removeLabelFromNode(DatabaseActions.java:369)
at org.neo4j.server.rest.web.RestfulGraphDatabase.removeNodeLabel(RestfulGraphDatabase.java:510)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)
at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
at org.neo4j.server.rest.transactional.TransactionalRequestDispatcher.dispatch(TransactionalRequestDispatcher.java:132)
at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:288)
at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1469)
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1400)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1349)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1339)
at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416)
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:537)
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:699)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:698)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1506)
at org.neo4j.server.rest.security.SecurityFilter.doFilter(SecurityFilter.java:112)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1477)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:503)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:211)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1096)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:432)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:175)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1030)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:136)
at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
at org.eclipse.jetty.server.Server.handle(Server.java:445)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:268)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:229)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.run(AbstractConnection.java:358)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:601)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:532)
at java.lang.Thread.run(Thread.java:724)

Issue 2:
I have a single tuple / triple, say nodes A and B with a relationship R.

If I return the triple by specifying the Ids for A and B:=

MATCH (a)-[conn]->(b)
WHERE a.`object ID`=1660 AND b.`object ID`=1659
RETURN a As startSt,b As endSt,conn As relationship

and export as JSON I get the 2 nodes (A and B) under 'nodes' followed by the connector under 'relationships'.

If, however, I just match the connector to return the triple:-

MATCH (a)-[conn {`connector ID`: 1048}]-(b)
RETURN a As startSt,b As endSt,conn As relationship

I get a different result in the JSON - I get two identical rows, each consisting of the nodes A, B followed by the relationship R.

In both cases the display of the single triple is identical as you'd expect. This appears to be a bug since in the second case the single triple displayed is described twice in the JSON output.