Ref: Moved assertions to where they belong