Fixed stupid errors in EMA functions