Interim commit to add some error checking and missed cases