Add assertion about no errors after primary output and fix the NoneType bug