Fixed so that even if you’re missing the end field, everything is fine

My first OKF contribution! I doubt this is much help, but I thought I’d have a go. Awesome project!