Fix build error.
Improve compile() function.
Fix tests.