Fixed the private prev method and both next and prev public functions.