Remove redundant error checking code