Error checking merged to dev