Fixed ending issues