Fix bug in Scala-Task4