A few changes to make core modules compilable
Fix incomplete pattern matching warning in a few functions

All projects are compilable now.