Error Checks

Just did some error-checking