Added additional sanity checking