Fixing some minor bugs for compilation.