Fixed parsekey() for tuples, added tests