Fix bugs; add modulo macro operator