More idiomatic error checking for config parsing