Add assert statement, fix some L3 bugs