Additional error checking to prevent notices