Fixed an issue with handler capture and EOLs