Improved error detection to better match Telonics
fixed formatting errors
Fix some date checking