Fix backwritten output not being included in distance measurements