Bugfix invalid cursor reference.

+ Bug introduced in commit 92c52aa49bb8c5719f863f2a68bd93d2207e7844.