Changed the implementation of is_zero