Some bugfixes

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Debug output in 'pending' test removed

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>