Fix for all NaN frames
Minor formatting and comment changes