Fixed a bug which was causing successful optimizations to not be counted correctly.