# changed WC detection
# fixed potential null pointers