Fixes bug in stability criterion