Fixed endless loop
Fixed multiple headers order
Small cleanup