Fixed compilation errors after introducing static type checking