Unit tests + bug fixes for --incremental