Add more asserts

It should help in localizing any abnormal situations