macros: include <algorithm> for std::min, std::max.
reader: return NULL instead of FALSE.