Enable debug mode for testing, fix cache and build dir variables.