Add more error assertions