More clear error message and use -ne instead of !=