Add sanity checks for debugging possible errors in the driver. Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>