compile: Better handling of internal sources