Remove surplus code.

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
Re-factor assertions.

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>