Fix compilation bugs and infinished spots of code.