Send correct close frame if frame is to big
Cleanup and minor adjustments