Have you called XSCREEN in your program? If so, could you check second argument of XSCREEN? If it is less than 1, the error you mentioned can occur.