Fix invalid scala code