Support more statuses

Signed-off-by: Jonas Zetterberg <jonas.zetterberg@ericsson.com>
Improve variable handling

Signed-off-by: Jonas Zetterberg <jonas.zetterberg@ericsson.com>