class & assertion fixes
(cherry picked from commit 34c1aa0)