change assertions to signal Kernel errors instead