Added negative error checking