Add better error message for some problems