Fixed last chunk handling.