Make debugging from intellij possible and fix a randomly failing test case

Signed-off-by: Andreas Pieber <anpieber@gmail.com>