 	/// `Reference` will be returned.
 	public func referenceWithName(name: String) -> Result<ReferenceType, NSError> {
 		var pointer: COpaquePointer = nil
-		let repository = self.pointer
-		let result = git_reference_lookup(&pointer, repository, name)
+		let result = git_reference_lookup(&pointer, self.pointer, name)
 		
 		if result != GIT_OK.value {
 			return failure(libGit2Error(result, libGit2PointOfFailure: "git_reference_lookup"))

	/// Returns an array of remotes, or an error.
	public func allRemotes() -> Result<[Remote], NSError> {
		let pointer = UnsafeMutablePointer<git_strarray>.alloc(1)
		let repository = self.pointer
		let result = git_remote_list(pointer, repository)
		
		if result != GIT_OK.value {
			pointer.dealloc(1)

	/// Load all the references with the given prefix (e.g. "refs/heads/")
	public func referencesWithPrefix(prefix: String) -> Result<[ReferenceType], NSError> {
		let pointer = UnsafeMutablePointer<git_strarray>.alloc(1)
		let result = git_reference_list(pointer, self.pointer)
		
		if result != GIT_OK.value {
			pointer.dealloc(1)
