some bugfixes for SLD