Fix assertions (close: #218)