Adding initial support for more error checking