Checking exit behavior

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