Fix some broken code