mode compilation fixes