default value for direction and better error raising (thanks @jerith)