Fix some cast issues when building with newer bukkit