TD5: fixing assertions (fixes #2)