Added use of BlockExceptions instead of asserts in block.py