Replaced nullptr with 0 in rules.hpp. Various cleanups.