Value::refcount() is now const, and fixed a memory leak in return values