Updated code (added asserts) after latest bug fixes