plugin detection and other misc fixes